package com.hhss.qishi.DPtest.designpattern.decorator;

public class Cup extends ComponentDecorator {

    private Beverage beverage;

    public Cup(Beverage beverage, String cupType){
        this.beverage = beverage;
        this.beverage.setSize(cupType);
    }

    @Override
    public String getDescription() {
        return this.beverage.getDescription() + " ," + this.beverage.getSize();
    }

    @Override
    public double cost() {
        if(this.beverage.getSize().equals("大杯")){
            return this.beverage.cost() + 4.0;
        }else{
            return this.beverage.cost();
        }
    }
}
